package net.metashare.grah.logic

/**
 * Grah is a notion produced by metashare.net
 * User: dsherema
 * Date: May 1, 2010
 * Time: 4:55:24 PM
 *
 */
class TestProperty implements Predicate {
  def String propertyName
  def Predicate predicate


  def TestProperty(propertyName, predicate) {
    this.propertyName = propertyName;
    this.predicate = predicate;
  }

  def boolean apply(Object object) {
    Object o = object.metaClass.getProperty(propertyName)
    return predicate.apply(o)
  }


}
